import React from "react";
import lazyLoad from "@/routers/utils/lazyLoad";
import { LayoutIndex } from "@/routers/constant";
import { RouteObject } from "@/routers/interface";

const userRouter: Array<RouteObject> = [
	{
		element: <LayoutIndex />,
		meta: {
			title: "博客管理"
		},
		children: [
			{
				path: "/blog/index",
				element: lazyLoad(React.lazy(() => import("@/views/blog/BlogList/index"))),
				meta: {
					requiresAuth: true,
					title: "我的博客",
					key: "blogList"
				}
			},
			{
				path: "/blog/tag",
				element: lazyLoad(React.lazy(() => import("@/views/blog/TagList/index"))),
				meta: {
					requiresAuth: true,
					title: "我的标签",
					key: "tag"
				}
			},
			{
				path: "/blog/subfield",
				element: lazyLoad(React.lazy(() => import("@/views/blog/SubfieldList/index"))),
				meta: {
					requiresAuth: true,
					title: "我的分栏",
					key: "subfield"
				}
			},
			{
				path: "/blog/editor",
				element: lazyLoad(React.lazy(() => import("@/views/blog/Editor/index"))),
				meta: {
					requiresAuth: true,
					title: "编辑器",
					key: "editor"
				}
			}
		]
	}
];

export default userRouter;
